

from tkinter import *

# pack,grid place

# pack 按添加顺序
# grid 按行列


root= Tk() 




# Label(root,text="name").grid(
#     row=0,
#     sticky=W)
# Label(root,text="pass").grid(row=1)

# Entry(root).grid(row=0,column=1)
# Entry(root,show="*").grid(
#     row=1,
#      column=1)

# img =PhotoImage(
#     file="../mm/005TgvqCgy1ftv5m7ct6vg30c307ox6p.gif")

# img1=Label(root,image=img)

# 跨行跨列
# img1.grid(row=0,column=2,rowspan=2,columnspan=2)

# Button(text="submit",width=10).grid(
#     row=2,columnspan=4,
#     padx=10,pady=10)


# place

# img2= PhotoImage(
#     file="../mm/005TgvqCgy1ftv5m7ct6vg30c307ox6p.gif")

# Label(root,image=img2).pack()

# Button(text="正中央").place(
#     relx=0.5,rely=0.5,
#     anchor=CENTER
# )

# 

Label(root,bg="red").place(
    relx=0.5,rely=0.5,
    relwidth=0.75,
    relheight=0.75,
    anchor=CENTER)
Label(root,bg="black").place(
    relx=0.5,rely=0.5,
    relwidth=0.5,
    relheight=0.5,
    anchor=CENTER)
Label(root,bg="orange").place(
    relx=0.5,rely=0.5,
    relwidth=0.2,
    relheight=0.2,
    anchor=CENTER)

mainloop()